package cn.cvs.service;

import cn.cvs.dao.SysUserMapper;
import cn.cvs.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SysUserServiceImpl  implements SysUserService {
   @Autowired
    private SysUserMapper sysUserDao;
    @Override
    public SysUser login(String account, String password) {
        return sysUserDao.login(account, password);
    }

    @Override
    public int getUserCount(String name, Integer id) throws Exception {
        return sysUserDao.selectCount(name,id);
    }

    @Override
    public List<SysUser> getUserList(String realName, Integer roleId, Integer pageIndex, Integer pageSize) throws Exception {
        int pageBegin = (pageIndex - 1) * pageSize;
        return this.sysUserDao.getUserList(realName, roleId, pageBegin, pageSize);
    }
}
